<!DOCTYPE html>
<html lang="en">
<head>
	<title></title>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<link rel="stylesheet" href="__CSS__/bootstrap.min.css"/>
	<link rel="stylesheet" href="__CSS__/bootstrap-responsive.min.css"/>
	<link rel="stylesheet" href="__CSS__/uniform.css"/>
	<link rel="stylesheet" href="__CSS__/select2.css"/>
	<link rel="stylesheet" href="__CSS__/matrix-style2.css"/>
	<link rel="stylesheet" href="__CSS__/matrix-media.css"/>
	<link href="__FONT__/css/font-awesome.css" rel="stylesheet"/>
	<link rel="stylesheet" href="__CSS__/changyun.css"/>
	<style>
		.table th, .table td {
			line-height: 20px;
			text-align: center;
			border-top: 1px solid #ddd;
			padding: 5px 0 5px 10px;
			vertical-align: middle;
		}
	</style>
</head>
<body>
<div id="content">
	<include file="Public/maintop"/>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-content" style="padding:5px;border:0px;">
						<form action="__ACTION__" method="get">
							<div class="fr table-button">
								<button type="submit" class="btn btn-success"><i class="icon-search"></i> 搜索</button>
							</div>
							<div class="fr table-button">
								<select style="width:150px;" name="status">
									<option value="0">==状态==</option>
									<option value="1"
									<if condition="1 eq $gget['status']">selected</if>
									>已联系</option>
									<option value="-1"
									<if condition="-1 eq $gget['status']">selected</if>
									>待联系</option>
								</select>
							</div>
						</form>
					</div>
					<div class="widget-content" style="padding:5px;">
						<table class="table table-bordered table-striped with-check" style="margin-bottom: 0px;">
							<thead>
							<tr>
								<th width="30" style="text-align: center;">
									<input type="checkbox" class="tpl-table-fz-check" id="all_check"></th>
								<th width="50" style="text-align:center;">ID</th>
								<th width="60" style="text-align:center;">发起人</th>
								<th width="60" style="text-align:center;">内容</th>
								<th width="60" style="text-align:center;">图片</th>
								<th width="80">状态</th>
								<th width="60">创建时间</th>
								<th width="60">更新时间</th>
							</tr>
							</thead>
							<tbody>
							<notempty name="list_data.list_data">
								<volist name="list_data.list_data" id="data">
									<tr class="text-c">
										<td style="text-align: center;">
											<input type="checkbox" name="check_id" value="{#$data.id}"/></td>
										<td align="center">{#$data.id}</td>
										<td>
											<div rel="pop" style="display: flex">
												<img style="width: 40px;height: 40px;border-radius: 50%;border:1px solid #efefef;" src="{#$data.user_headimg}"><br>
												{#$data.user_nickname}
											</div>
										</td>
										<td style="color:#ff0000;">
											<span>{#$data.content}</span>
										</td>
										<td>
											<volist name="data.images" id="img">
												<img src="{#$img}" onclick="viewImage(this)" style="cursor: pointer;width: 50px;height: 50px;margin-top: 10px"/><br/>
											</volist>

										</td>
										<td>
											<if condition="$data.status ==1">
												<a href="javascript:void(0);" class="btn btn-mini btn-success">已联系</a>
												<else/>
												<a href="javascript:void(0);" onclick="updateStatus({#$data['id']},'status',1,'已联系')" class="btn btn-mini btn-danger"><i class="icon-cog"></i> 待联系</a>
											</if>
										</td>
										<td>{#$data.add_time|time_format}</td>
										<td>{#$data.update_time|time_format}</td>
									</tr>
								</volist>
								<else/>
								<td colspan="7" class="text-center"> 暂时还没有信息!</td>
							</notempty>
							</tbody>
						</table>
						<div id="hongxin_page_view">{#$list_data._page}</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.ui.custom.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.uniform.js"></script>
<script src="__JS__/select2.min.js"></script>
<script src="__JS__/matrix.js"></script>
<script src="__JS__/matrix.tables.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/action.js"></script>

<script>

function viewImage(obj) {
	var img = new Image();
	img.src = obj.src;
	var imgHtml = "<img src='" + obj.src + "' width='500px' height='500px'/>";
	//弹出层
	layer.open({
		type: 1,
		shade: 0.8,
		offset: 'auto',
		area: [300 + 'px', 370 + 'px'],  // area: [width + 'px',height+'px']  //原图显示
		shadeClose: true,
		scrollbar: true,
		title: "图片预览", //不显示标题
		content: imgHtml, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
		cancel: function() {
			//layer.msg('捕获就是从页面已经存在的元素上，包裹layer的结构', { time: 5000, icon: 6 });
		}
	});
}

function updateStatus(id, faild, status, message) {
	layer.confirm('确定要更新状态为' + message + '吗', {
		title: '提示',
		icon: 0,
		btn: ['确定', '取消'] //按钮
	}, function(e) {
		layer.close(e);
		var loadi = null;
		loadi = layer.load(2);
		$.ajax({
			type: "GET",
			data: {aid: id, field: faild, status: status, _: Date.now()},
			dataType: "json",
			url: "{#:U('setStatus1')}",
			success: function(rdata) {
				layer.close(e);
				layer.close(loadi);
				if (rdata.status == 1) {
					layer.alert(rdata.msg, {icon: 1}, function() {
						window.location.reload();
					});
					return false;
				} else {
					layer.alert(rdata.msg, {icon: 0});
					return false;
				}
			}
		});
	}, function(e) {
		layer.close(e);
	});
}

</script>
</body>
</html>
